#include "my_stdio.h"
#include <stdio.h> //用于NULL
#include <string.h>
#include <unistd.h>
int main()
{
    mFILE *fp = mfopen("./log.txt", "w");
    if(fp == NULL)
    {
	return 1;
    }
    int cnt = 10;
    while(cnt > 0)
    {
	char buffer[64];
	snprintf(buffer, sizeof(buffer), "hello message, number is:%d\n",cnt);

	cnt--;

	mfwrite(buffer, strlen(buffer), fp);
	mfflush(fp);
	sleep(1);
    }
    mfclose(fp);
    return 0;
}
